﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IDeployableProjectRepository.cs" company="Elilink">
//   Defor
// </copyright>
// <summary>
//   Interface IDeployableProjectRepository. For manipulating deployable project properties
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace DataAccessLayer.Repositories.Abstract
{
    using System.Collections.Generic;

    using BusinessLayer.Objects;
    using BusinessLayer.Results;

    /// <summary>
    ///     Interface IDeployableProjectRepository. For manipulating deployable project properties
    /// </summary>
    public interface IDeployableProjectRepository
    {
        #region Public Methods and Operators

        /// <summary>
        /// Adds the deployable project.
        /// </summary>
        /// <param name="project">
        /// The project.
        /// </param>
        /// <returns>
        /// The <see cref="BusinessLayer.Results.OperationResult"/>.
        /// </returns>
        OperationResult AddDeployableProject(DeployableProject project);

        /// <summary>
        ///     Deletes all projects for all target systems.
        /// </summary>
        /// /// <returns>The <see cref="BusinessLayer.Results.OperationResult"/>.</returns>
        OperationResult ClearAllDeployableProjects();

        /// <summary>
        /// Deletes all projects for specified target system.
        /// </summary>
        /// <param name="targetSystem">
        /// The target system.
        /// </param>
        /// <returns>
        /// The <see cref="BusinessLayer.Results.OperationResult"/>.
        /// </returns>
        OperationResult ClearDeployableProjectsForTargetSystem(string targetSystem);

        /// <summary>
        /// Deletes the deployable project.
        /// </summary>
        /// <param name="projectName">
        /// Name of the project.
        /// </param>
        /// <param name="targetSystem">
        /// The target system.
        /// </param>
        /// <returns>
        /// The <see cref="BusinessLayer.Results.OperationResult"/>.
        /// </returns>
        OperationResult DeleteDeployableProject(string projectName, string targetSystem);

        /// <summary>
        ///     Disposes the context.
        /// </summary>
        void DisposeContext();

        /// <summary>
        /// Gets the deployable projects.
        /// </summary>
        /// <param name="targetSystem">
        /// The target system.
        /// </param>
        /// <returns>
        /// List of <see cref="BusinessLayer.Objects.DeployableProject"/>.
        /// </returns>
        List<DeployableProject> GetDeployableProjects(string targetSystem);

        /// <summary>
        /// Updates the deployable project.
        /// </summary>
        /// <param name="project">
        /// The project.
        /// </param>
        /// <returns>
        /// The <see cref="BusinessLayer.Results.OperationResult"/>.
        /// </returns>
        OperationResult UpdateDeployableProject(DeployableProject project);

        /// <summary>
        /// Allows to completely update the deployable project.
        /// </summary>
        /// <param name="project">
        /// The project.
        /// </param>
        /// <param name="oldName">
        /// The old name.
        /// </param>
        /// <param name="oldTargetSystem">
        /// The old target system.
        /// </param>
        /// <returns>
        /// The <see cref="OperationResult"/>.
        /// </returns>
        OperationResult UpdateDeployableProjectFull(DeployableProject project, string oldName, string oldTargetSystem);

        #endregion
    }
}